package com.atguigu.yygh.common.exception;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;

/**
 * 自定义异常
 * @author Zyyyyu
 */
@Getter
@ApiModel(value = "ServiceException",description = "自定义异常")
public class ServiceException extends RuntimeException{

    @ApiModelProperty("异常状态码")
    private final String code;


    @ApiModelProperty("异常信息")
    private Object data;

    public ServiceException(String code,String msg) {
        super(msg);
        this.code = code;
    }

    public ServiceException(String code,String msg,Object data) {
        super(msg);
        this.code = code;
        this.data = data;
    }

}
